home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / patches / pgs3f.lha / 3.0fUpdate / Macros.LHA / FontSpec.rexx < prev    next >
OS/2 REXX Batch file  |  1995-02-07  |  6KB  |  209 lines

  1. /* $VER: FontSpec.rexx 1.0 (07.02.94)
  2.    Copyright 1994 Soft-Logik Publishing Corporation
  3.    May not be distributed without Soft-Logik Publishing Corporation's express written permission */
  4.  
  5. OPTIONS RESULTS
  6. TRACE OFF
  7.  
  8. /* Make sure rexx support is opened */
  9. IF ~SHOW('L','rexxsupport.library') THEN
  10.    CALL ADDLIB('rexxsupport.library',0,-30)
  11.  
  12. ADDRESS 'PAGESTREAM'
  13.  
  14. /* Give Instructions */
  15. allocarexxrequester '"Create Font Specimen Sheets"' 592 111
  16.     reqhandle=result
  17. addarexxgadget reqhandle EXIT 12 94 70 label "_Ok"
  18.     Okhandle=result
  19. addarexxgadget reqhandle EXIT 510 94 70 label "_Cancel"
  20.     Cancelhandle=result
  21. addarexxgadget reqhandle TEXT 8 10 576 border none string "'This macro will print a font specimen sheet for each font installed'"
  22. addarexxgadget reqhandle TEXT 8 20 576 border none string "'with the Font Preferences requester. Font specimen sheets are useful'"
  23. addarexxgadget reqhandle TEXT 8 30 576 border none string "'for selecting fonts to use. Before using this macro, you should add the'"
  24. addarexxgadget reqhandle TEXT 8 40 576 border none string "'font directories you want specimen sheets for to the Font Preferences'"
  25. addarexxgadget reqhandle TEXT 8 50 576 border none string "'requester, and remove the font directories which you do not want sheets'"
  26. addarexxgadget reqhandle TEXT 8 60 576 border none string "'for. Turn you printer on before continuing. Note: printing a page for'"
  27. addarexxgadget reqhandle TEXT 8 70 576 border none string "'each font can take a long time.'"
  28. doarexxrequester reqhandle
  29.  
  30. action=result
  31. freearexxrequester reqhandle
  32. if action~=okhandle then EXIT
  33.  
  34. /* Make the font spec document */
  35. 'NEWDOCUMENT FontSpec '
  36. 'SETDOCUMENTDESC "" '
  37. 'NEWMASTERPAGE "Default Master Page" 8.5i 11i PORTRAIT SINGLE '
  38. 'SETMASTERPAGEDESC "" '
  39. 'SETDIMENSIONS 8.5i 11i PORTRAIT SINGLE '
  40. 'SETBLEED 0i 0i '
  41. 'SETMARGINGUIDES 0.5i 0.5i 1i 1i '
  42. 'SETCOLUMNGUIDES 1 0.25i '
  43. 'SETDOCUMENTSTATUS UNCHANGED '
  44. 'OPENWINDOW View.1 PAGE 1 '
  45.  
  46. openbusyrequester message "'Preparing FontSpec document...'" thermometer enabled abort enabled total 100 current 0
  47. bh=result
  48.  
  49. /* Draw the surrounding box */
  50. 'drawbox 0.5i 1i 8i 10i'
  51.  
  52. /* Make the style tag */
  53. 'newstyletag "FontSample" character'
  54.  
  55. /* Make the title */
  56. 'settoolmode text'
  57. 'drawtextobj 0.75i 1.25i'
  58. thandle=result
  59. 'selecttext at 0.75i 1.25i'
  60. 'settypesize 36pt'
  61. 'setfont Triumvirate'
  62. 'settypestyle Bold'
  63. 'insert "Font Name"'
  64.  
  65. call setbusy(5)
  66.  
  67. sizes.1=10
  68. sizes.2=12
  69. sizes.3=15
  70. sizes.4=18
  71. sizes.5=24
  72. sizes.6=36
  73. sizes.7=48
  74.  
  75. /* Make the text frames */
  76. 'drawcolumn 0.75i 2i 1.25i 4.75i columns 1 gutter 0'
  77. sfhandle=result
  78. 'selecttext at 0.75i 2i'
  79. 'settypesize 10pt'
  80. do i=1 to 7
  81.     'setleading fixed 'sizes.i+2'pt'
  82.     'insert 'sizes.i'pt'
  83.     'insertcontrol newparagraph'
  84.     call setbusy(5+4*i)
  85. end i
  86.  
  87. 'drawcolumn 1.25i 2i 7.75i 4.75i columns 1 gutter 0'
  88. tfhandle=result
  89. 'selecttext at 1.25i 2i'
  90. 'setcharacterstyle "FontSample"'
  91. do i=1 to 7
  92.     'setleading fixed 'sizes.i+2'pt'
  93.     'settypesize 'sizes.i'pt'
  94.     'insert "The Quick Brown Fox"'
  95.     'insertcontrol newparagraph'
  96.     call setbusy(33+4*i)
  97. end i
  98.  
  99. 'drawtextobj 0.75i 5i'
  100. 'selecttext at 0.75i 5i'
  101. 'settypesize 18pt'
  102. 'setfont Triumvirate'
  103. 'settypestyle Bold'
  104. 'insert "Character Set Sample"'
  105.  
  106. call setbusy(66)
  107.  
  108. 'drawcolumn 0.75i 5.5i 7.75i 7.25i columns 1 gutter 0'
  109. mfhandle=result
  110. 'selecttext at 0.75i 5.5i'
  111. 'setcharacterstyle "FontSample"'
  112. 'settypesize 24pt'
  113. 'insert abcdefghijklmnopqrstuvwxyz'
  114. call setbusy(69)
  115. 'insertcontrol newparagraph'
  116. 'insert ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  117. call setbusy(72)
  118. 'insertcontrol newparagraph'
  119. 'insert 1234567890!@#$%^&*<?>'
  120. call setbusy(75)
  121.  
  122.  
  123. 'drawtextobj 0.75i 7.5i'
  124. 'selecttext at 0.75i 7.5i'
  125. 'settypesize 18pt'
  126. 'setfont Triumvirate'
  127. 'settypestyle Bold'
  128. 'insert "Body Text Sample"'
  129.  
  130. call setbusy(80)
  131.  
  132. 'drawcolumn 0.75i 8i 7.75i 9.75i columns 1 gutter 0'
  133. bfhandle=result
  134. 'selecttext at 0.75i 8i'
  135. 'setcharacterstyle "FontSample"'
  136. 'settypesize 12pt'
  137. 'setleading fixed 14pt'
  138. 'insert "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of"'
  139. call setbusy(87)
  140. 'insert " incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us,"'
  141. call setbusy(94)
  142. 'insert " we had nothing before us, we were all going direct to Heaven, we were all going direct the other way."'
  143. call setbusy(100)
  144. closebusyrequester bh
  145.  
  146. /* Get the names and number of faces */
  147. getfontfamilies faces
  148. facecount=result
  149.  
  150. /* Count Fonts */
  151. fontcount=0
  152. do i=0 to facecount-1
  153.     getfontstyles faces.i styles
  154.     stylecount=result
  155.  
  156.     /* Repeat for each style */
  157.     do ii=0 to stylecount-1
  158.         fontcount=fontcount+1
  159.     end ii
  160. end i
  161.  
  162.  
  163. /* MAIN LOOP */
  164. openbusyrequester message "'Creating Font Samples...'" thermometer enabled abort enabled total fontcount current 0
  165. bh=result
  166. printcount=0
  167. do i=0 to facecount-1
  168.     getfontstyles faces.i styles
  169.     stylecount=result
  170.  
  171.     /* Repeat for each style */
  172.     do ii=0 to stylecount-1
  173.         printcount=printcount+1
  174.  
  175.         /* Change the title */
  176.         'selecttext at 0.75i 1.25i'
  177.         'selecttext all'
  178.         'insert "'faces.i'-'styles.ii'"'
  179.  
  180.         /* Change the font and style */
  181.         'refresh wait'
  182.         'clearstyletag FontSample'
  183.         'setfont 'faces.i' styletag FontSample'
  184.         'settypestyle 'styles.ii' styletag FontSample'
  185.         'refresh continue'
  186.  
  187.         /* Print the font sample page */
  188.         call setbusy(printcount)
  189.         'printdocument copies 1 page 1 sides both scale actual output grayscale printermarks off mirror off negative off'
  190.     end ii
  191. end i
  192. call cleanup()
  193. EXIT
  194.  
  195.  
  196. SETBUSY:
  197.     parse arg value
  198.     ADDRESS PAGESTREAM
  199.     setbusyrequester bh current value
  200.     getbusyrequester bh
  201.     if result=1 then call CLEANUP(1)
  202.     ADDRESS COMMAND
  203. RETURN
  204.  
  205. CLEANUP:
  206.     closebusyrequester bh
  207.     'closedocument force'
  208. EXIT
  209.